import React, { Component } from 'react';
import {NavLink, Route, Switch, withRouter, Redirect} from 'react-router-dom'
import {Container} from './style'
import Check from '../../components/Check'
import CheckContent from '../../components/CheckContent'
import Recyle from '../../components/Recyle'
import PutInStorage from '../../components/PutInStorage'
import Instore from '../../components/PutInStorage/Instore'

// import CheckContent from '../../components/CheckContent'
// import connect from './connect'
// @connect
@withRouter
class index extends Component {
  componentDidMount(){
    // 在这里发送每个页面获取数据的请求
    // this.props.setSwiperData()
  }
  render() {
    return (
      <Container>
        {/* 导航 */}
        <ul className='topNav'>
                  <li>
                    <NavLink to='/management/putinstorage'>入库</NavLink>
                  </li>
                  <li>
                    <NavLink to='/management/warehouseout'>出库</NavLink>
                  </li>
                  <li>
                    <NavLink to='/management/check/survey'>盘点</NavLink>
                  </li>
                  <li>
                    <NavLink to='/management/recyle'>回收站</NavLink>
                  </li>
                </ul>




        <Switch>
         {/* <Redirect exact from="/management/check" to="/management/check/survey"/> */}
         <Redirect exact from="/management" to="/management/putinstorage"/>
         <Route path="/management/putinstorage" component={PutInStorage}/>
         <Route path="/management/check/survey" component={Check}/>
         <Route path="/management/check/detail" component={ CheckContent} />
         <Route path="/management/recyle" component={ Recyle} />
          <Route path="/management/instore" component={Instore} />
       </Switch>
      </Container>
    );
  }
}

export default index;

